<?php
include_once("inc/config.php");
include_once("inc/conn.php");
include_once("inc/function.php");
if(! isset($_SESSION["get_pwd_ac"]) ){
	header("Location: forgetpass.php");
	exit();
}
$username=$_SESSION["get_pwd_ac"];
$sql = "select id,mobile,is_check_email from users where username = '{$username}' limit 1";
$result = $db->query($sql);
$id=0;
$users = $db->fetch_row($result);
if(empty($users)){
	header("Location: forgetpass.php");
	exit();
}
$phone=$users[1];
$is_check_email=$users[2];
if(!empty($phone)){
	$phone=str_replace(substr($phone,3,4),"****",$phone);
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php 
    require 'public/title.inc.php';
?>
<title>找回登录密码 - <?php echo $web_name ;?></title>
<link rel="stylesheet" type="text/css" href="style/loginRegister.css" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/forgetpass_1.js"></script>
</head>
<body>
<?php 
    require 'top.php';
?>
<div class="container">
	<div class="com">
        <div class="forget">
            <h4>找回密码</h4>
            <div class="clearfix">
                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 media_pad">
                    <div class="media">
                        <div class="media-left"><span class="pass_gray">1</span></div>
                        <div class="media-body"><span class="success">输入绑定的手机号码</span></div>
                        <p></p><p></p>
                    </div>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3  media_pad">
                    <div class="media media_border">
                        <div class="media-left"><span class=" pass_bg">2</span></div>
                        <div class="media-body"><span class="success">验证身份</span></div>
                        <p></p><p></p>
                    </div>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3  media_pad">
                    <div class="media">
                        <div class="media-left"><span class="pass_gray">3</span></div>
                        <div class="media-body"><span class="success">重设密码</span></div>
                        <p></p><p></p>
                    </div>
                </div>  
                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3  media_pad">
                    <div class="media">
                        <div class="media-left"><span class="pass_gray">4</span></div>
                        <div class="media-body"><span class="success">重设密码成功</span></div>
                        <p></p><p></p>
                    </div>
                </div>  
            </div>  
        </div>
        <div class="row">
            <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">
                <dl>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">账　　　　　号 :</span>
                            <input type="text" class="form-control" id="username" disabled="disabled" value="<?php echo $_SESSION["get_pwd_ac"]; ?>" />
                        </div>
                    </dd>
                 
                    <?php if(empty($phone)){?>
                    <dd class="type_sms <?php if(empty($phone)){?> none<?php }?>">
                        你还没有绑定手机号！
                    </dd>
                    <?php }else{ ?>
                    <dd class="type_sms">
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">绑定的手机号码 :</span>
                            <input type="text" disabled="disabled" class="form-control" value="<?php echo $phone ;?>" />
                            <span class="input-group-addon"><button class="btn btn-danger" id="get_check_code_sms" style="padding:0 12px;">获取验证码</button></span>
                        </div> 
                    </dd>
                    <?php } ?>
                    <?php if($is_check_email==0){ ?>
                    <dd class="type_email <?php if(!empty($phone)){?> none<?php }?>">
                        邮箱没有认证，不能用来找回密码，需要帮助请联系客服.
                    </dd>  
                    <?php }else{ ?>  
                    <dd class="type_email <?php if(!empty($phone)){?> none<?php }?>">
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">绑定的邮箱号码 :</span>
                            <input type="text" disabled="disabled" class="form-control" value="<?php echo $username ;?>" />
                            <span class="input-group-addon"><button class="btn btn-danger" id="get_check_code_email" style="padding:0 12px;">获取验证码</button></span>
                        </div>  
                    </dd>
                    <?php } ?>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">接收到的验证码 :</span>
                            <input type="text" id="check_code" class="form-control" placeholder="输入接收到的验证码" />
                        </div>
                    </dd>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">验　　证　　码 :</span>
                            <input type="text" class="form-control" id="vcode" placeholder="验证码" />
                            <span class="input-group-addon"><img src="vcode.php" alt="验证码" onclick="this.src='vcode.php?tm=' + Math.random();" style="cursor:pointer;" /></span>
                        </div>
                    </dd>
                    <dd>
                        <input type="submit" class="btn btn-danger btn-block btn-lg" id="login" value="下一步"  />
                    </dd>
                </dl>
            </div>
            <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
                <img src="img/login-pic.jpg" class="img-responsive" style="margin:12px 20px; border-radius:10px;" />
            </div>
        </div>   


    </div>
</div>
<?php 
    require 'footer.php';
 ?>   
</body>
</html>